﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GcmpModelInterface.h"
#include "IDrawingViewport.h"
#include "IDrawingViewportCamera.h"
#include "IPolygon.h"
#include "NdbDataSchema.h"

namespace gcmp 
{
    /// \brief 图纸中多视口接口类。

    FINAL_INTERFACE class GCMP_MODEL_INTERFACE_EXPORT IMultiMappingViewport : public IDrawingViewport
    {
        DEFINE_CAST_DERIVED(gcmp::IMultiMappingViewport, gcmp::IDrawingViewport);

     public:
         /// \brief 析构函数
         virtual ~IMultiMappingViewport();

         /// \brief 获取视口相机参数
         /// \return       IDrawingViewportCamera*
         virtual IDrawingViewportCamera* GetViewportCamera() = 0;

         /// \brief 获取视口相机参数
         /// \return       const
         virtual const IDrawingViewportCamera* GetViewportCamera() const = 0;

         /// \brief 获取Implementation Uid
         ///
         /// \return UniIdentity 返回ImplementationUid
         static UniIdentity GetImplementationUid();

         /// \brief 设置代表视口范围的多边形
         ///
         /// 注意：该多边形为创建时局部坐标系下的未经过视图比例缩放的多边形，局部坐标系可以通过GetViewportCamera()->GetProjectionCoord()获取
         /// \param pPolygon 多边形指针，目前仅支持直线段组成的多边形
         /// \return 返回true表示设置成功，false表示设置失败
         virtual bool SetPolygon(OwnerPtr<IPolygon> pPolygon) = 0;

         /// \brief 获取代表视口范围的多边形
         ///         
         /// \return 返回多边形指针
         virtual const IPolygon* GetPolygon() const = 0;

         /// \brief 获取视口是否为多边形视口
         ///         
         /// \return 返回true表示是多边形视口，false表示为普通多视口
         virtual bool IsPolygonViewport() const = 0;
    };
}
